/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Interface;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Guilherme
 */
public class Inicial extends javax.swing.JFrame {

    /**
     * Creates new form Inicial
     */
    public Inicial() {
       
        if(Base.Perguntas.primeiro){
            ThreadLoading load = new ThreadLoading(this);
            setVisible(false);
            load.start();
            Base.Perguntas.primeiro=false;
        }
        initComponents();
       
    }
    
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();
        btnIniciar = new javax.swing.JButton();
        lblAjuda = new javax.swing.JLabel();
        lblProfessor = new javax.swing.JLabel();
        lblQuestoes = new javax.swing.JLabel();

        jButton1.setText("jButton1");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Quiz Responda e Aprenda");
        setResizable(false);
        getContentPane().setLayout(null);

        btnIniciar.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        btnIniciar.setText("INICIAR JOGO");
        btnIniciar.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        btnIniciar.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnIniciar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnIniciarActionPerformed(evt);
            }
        });
        getContentPane().add(btnIniciar);
        btnIniciar.setBounds(380, 500, 160, 40);

        lblAjuda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/ajuda.png"))); // NOI18N
        lblAjuda.setToolTipText("Ajuda");
        lblAjuda.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        lblAjuda.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblAjudaMouseClicked(evt);
            }
        });
        getContentPane().add(lblAjuda);
        lblAjuda.setBounds(860, 10, 40, 40);

        lblProfessor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/professor.png"))); // NOI18N
        lblProfessor.setToolTipText("Professor");
        lblProfessor.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        lblProfessor.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblProfessorMouseClicked(evt);
            }
        });
        getContentPane().add(lblProfessor);
        lblProfessor.setBounds(810, 10, 30, 40);

        lblQuestoes.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/inicial.jpg"))); // NOI18N
        getContentPane().add(lblQuestoes);
        lblQuestoes.setBounds(0, -10, 930, 600);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-923)/2, (screenSize.height-606)/2, 923, 606);
    }// </editor-fold>//GEN-END:initComponents

    private void btnIniciarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIniciarActionPerformed
        Questoes q = new Questoes();
        q.setVisible(true);
        q.setExtendedState(NORMAL);
        q.toFront();
        q.requestFocus();
        this.setVisible(false);
    }//GEN-LAST:event_btnIniciarActionPerformed

    private void lblProfessorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblProfessorMouseClicked
        Login l = new Login();
        l.setVisible(true);
        l.setExtendedState(NORMAL);
        l.toFront();
        l.requestFocus();
        this.setVisible(false);
    }//GEN-LAST:event_lblProfessorMouseClicked

    private void lblAjudaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblAjudaMouseClicked
        Ajuda aj = new Ajuda();
        aj.setVisible(true);
        aj.setExtendedState(NORMAL);
        aj.toFront();
        aj.requestFocus();
        this.setVisible(false);
    }//GEN-LAST:event_lblAjudaMouseClicked

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Inicial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Inicial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Inicial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Inicial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Inicial().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnIniciar;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel lblAjuda;
    private javax.swing.JLabel lblProfessor;
    private javax.swing.JLabel lblQuestoes;
    // End of variables declaration//GEN-END:variables
}

